home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13366 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: grimsel.zurich.ibm.com!usenet
  2. From: wgk@zurich.ibm.com (Keith Whittingham)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: C PORT command question
  5. Date: 7 Apr 1996 15:39:43 GMT
  6. Organization: IBM Research, ZRH
  7. Message-ID: <4k8njv$sre@grimsel.zurich.ibm.com>
  8. References: <4jurkh$4k9@newserv.ksu.ksu.edu>
  9. Reply-To: wgk@zurich.ibm.com
  10. NNTP-Posting-Host: pine.zurich.ibm.com
  11. X-Newsreader: IBM NewsReader/2 v1.00
  12.  
  13. In <4jurkh$4k9@newserv.ksu.ksu.edu>, mgn@ksu.ksu.edu (Marc Nuessen) writes:
  14. >I'm unfamiliar with the Port command and need to use it to send data
  15. >to a device card at address 300.
  16. >
  17. >How would I for example write a $FF to port address 300?
  18. >
  19. >How would I read from port address 300?
  20. >
  21. >Any help would be appreciated.
  22. >
  23. >Thanks.
  24. >
  25.  
  26. There is no "standard" way - it depends on the operating system and 
  27. compiler you're using. Having a guess you're on a PC using borland
  28.  
  29.    outp(0x300, 0x21);    // Out's a byte to port 0x300
  30.    outpw(0x300, 0x2AF1); // Out's a word to port 0x300
  31.    inp(0x300);           // In's a byte from port 0x300
  32.    inpw(0x300);          // In's a word from port 0x300
  33.  
  34. Keith
  35.  
  36.  
  37.  
  38.  
  39.  
  40.